package com.example.city_defense;

import com.badlogic.androidgames.framework.Pixmap;
import com.badlogic.androidgames.framework.Sound;

public class Enemy {
	
	public static final int UP = 0; 
	public static final int LEFT = 1;   
	public static final int DOWN = 2;   
	public static final int RIGHT = 3; 
	public int DIRECTION;
	 
	public int x, y;
	public int sizeX, sizeY;
	public int speed;
	public int blood;
	public int damage;
	public int armor;
	public int coinGain;
	public int point;
	public boolean isAlive;
	
	public Pixmap pixmap;
	public Sound sound;
		
	public int TYPE;
	
	public Enemy(int x, int y, int TYPE, Map map) {
		// TODO Auto-generated constructor stub
		this.x = x*50;
		this.y = y*50+75;
		this.TYPE = TYPE;
		this.speed = TYPE;
		this.blood = 10 * TYPE;
		this.damage = 0;
		this.armor = TYPE;
		this.coinGain = 10 * TYPE;
		this.point = 10 * TYPE;
		this.isAlive = true;
		this.pixmap = Asset.tank1;
		this.sound = Asset.boom;
		setDIRECTION(map);
	}
	
	public void setDIRECTION(Map map) {
		if(map.mapTYPE == 0)
			DIRECTION = DOWN;
		else
			DIRECTION = RIGHT;
	}
	
	public void move() {
		// TODO Auto-generated method stub	
	
		if(DIRECTION == UP)     
			this.y -= speed;       
		if(DIRECTION == LEFT)        
			this.x -= speed;      
		if(DIRECTION == DOWN)      
			this.y += speed;      
		if(DIRECTION == RIGHT)         
			this.x += speed;     
	}

	public void turnLeft(){         
		DIRECTION = LEFT;
	}
	
	public void turnUp(){         
		DIRECTION = UP;
	}
	
	public void turnDown(){         
		DIRECTION = DOWN;
	}
	
	public void turnRight(){         
		DIRECTION = RIGHT; 
	}
		
}